package cn.jimmie.learn.pbc.resource;

import android.content.res.AssetManager;
import android.content.res.Resources;

/**
 * function :
 *
 * <p> Create Time:  2019年02月21日 13:46 </p>
 * <p> @author Jimmie.Qian  </p>
 */
public class Plugin {
    private ClassLoader mPluginClassLoader;
    private AssetManager mPluginAssetManager;
    private Resources mPluginResources;

    public Plugin(ClassLoader classLoader, AssetManager assetManager, Resources resources) {
        this.mPluginClassLoader = classLoader;
        this.mPluginAssetManager = assetManager;
        this.mPluginResources = resources;
    }

    public ClassLoader getPluginClassLoader() {
        return mPluginClassLoader;
    }

    public AssetManager getPluginAssetManager() {
        return mPluginAssetManager;
    }

    public Resources getPluginResources() {
        return mPluginResources;
    }

    public boolean available() {
        return mPluginClassLoader != null &&
                mPluginAssetManager != null &&
                mPluginResources != null;
    }

    private boolean mAskUpdate = true;

    public boolean isAskUpdate() {
        return mAskUpdate;
    }

    public void setAskUpdate(boolean askUpdate) {
        this.mAskUpdate = askUpdate;
    }
}
